inherited dm_prescritor_grupo: Tdm_prescritor_grupo
  OldCreateOrder = True
  Left = 421
  Top = 231
  Height = 318
  inherited sqlConsulta: TSQLQuery
    SQL.Strings = (
      'select'
      '  a.cod_grupo,'
      '  a.descricao,'
      '  a.situacao,'
      '  a.data_cad,'
      '  a.data_alteracao,'
      '  case'
      '    when a.situacao = '#39'True'#39' Then '#39'ATIVO'#39' else '#39'INATIVO'#39
      '  end as situacao_desc,'
      
        '  (select count(b.lig_cod_grupo) from f_prescritor b where b.lig' +
        '_cod_grupo = a.cod_grupo) as total_presc'
      'from F_PRESCRITOR_GRUPO a'
      'where a.cod_grupo > 0')
  end
  inherited cdsConsulta: TClientDataSet
    object cdsConsultaCOD_GRUPO: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_GRUPO'
      Required = True
    end
    object cdsConsultaDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsConsultaSITUACAO: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO'
      Size = 5
    end
    object cdsConsultaDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsConsultaDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsConsultaSITUACAO_DESC: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO_DESC'
      Required = True
      FixedChar = True
      Size = 7
    end
    object cdsConsultaTOTAL_PRESC: TIntegerField
      Alignment = taCenter
      FieldName = 'TOTAL_PRESC'
    end
  end
  inherited qryPKChave: TSQLQuery
    SQL.Strings = (
      'SELECT GEN_ID(gen_f_prescritor_grupo,1)'
      'FROM RDB$DATABASE')
  end
  inherited cdsRegistro: TClientDataSet
    OnReconcileError = cdsRegistroReconcileError
    object cdsRegistroCOD_GRUPO: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_GRUPO'
      Required = True
    end
    object cdsRegistroDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsRegistroSITUACAO: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO'
      Size = 5
    end
    object cdsRegistroDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsRegistroDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
  end
  inherited sqlRegistro: TSQLQuery
    Params = <
      item
        DataType = ftInteger
        Name = 'codigo'
        ParamType = ptInput
      end>
    SQL.Strings = (
      'select'
      '  a.cod_grupo,'
      '  a.descricao,'
      '  a.situacao,'
      '  a.data_cad,'
      '  a.data_alteracao'
      'from F_PRESCRITOR_GRUPO a'
      'where a.cod_grupo = :codigo')
  end
end
